/**
 * 
 */
package baduga.core;

import java.io.IOException;
import com.google.gson.Gson;


/**
 * @author Janek
 *
 */
public abstract class Core_Network_Api 
{
	
	
	/** 0 - ścieżka do certfyfikatów, - 1 KeyStore, 2 - TrustStore */
	protected String dataCerts[] = new String [] {
			"./certs/", //Dirname
			"baduga_cert", //KeyStore
			"badu_keystore" //TrustStore
	};
	
	
	/** Hasła do certyfikatów  0 - KeyStore, 1  - TrustStore*/
	protected String passwords[] = new String[2];
	
	
	/** SSL Debug mode */
	protected static boolean sslDebug;
	
	
	/** Gson */
	protected final Gson gson = new Gson();
	
	
	
	/**
	 * Funkcja koduje dane do Jsona
	 * 
	 * @param args
	 * @return
	 */
	public String  encodeJson(final Core_JsonDataSchema args) throws IOException
	{
		return gson.toJson(args, Core_JsonDataSchema.class);
	}
	
	
	/**
	 * Funkcja dekoduje Json do postaci Object/String
	 * 
	 * @param args
	 * @return
	 */
	public Core_JsonDataSchema decodeJson(String jsonStr)
	{
		return gson.fromJson(jsonStr, Core_JsonDataSchema.class);
	}
	


	

}
